package org.example;

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class Main {

    private final static ZoneId zoneId = ZoneId.of("Asia/Shanghai");
    private final static String pattern = "yyyy-MM-dd HH:mm:ss";

    public static void main(String[] args) {
        String startTime = "2024-11-02 01:00:01";
        String endTime = "2024-11-04 03:22:11";
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern).withZone(zoneId);
        ZonedDateTime startTimeParse = ZonedDateTime.parse(startTime, formatter);
        ZonedDateTime endTimeParse = ZonedDateTime.parse(endTime, formatter);
        System.out.println(CalculateTimeSpan.calculateTimeSpan(startTimeParse,endTimeParse));
    }
}